#ifndef GPIO_CONREOL_H
#define GPIO_CONREOL_H

#include <stdbool.h>

typedef struct                  // 系统状态
{
    int errCount;               // 故障数量
    bool overTemperture;        // 温度过高
    bool overInCurrent;         // 输入过流
    bool overOutCurrent;        // 输出过流
    bool overOutVoltage;        // 输出过压
    bool lowInVoltage;          // 输入欠压(光照不足)
    bool lowOutVoltage;         // 输出欠压(蓄电池未连接)
    bool lowSystemVoltage;      // 系统电压过低
}SystemState;

/**
 * @brief 传感器上报数据类型
 * 
 */
typedef struct
{
    double involtage;
    double outvoltage;
    double incurrent;
    double outcurrent;
    double temp;

}OperatingData;    //TODO:

void InitGpio(void);
// void InitFaultDetection();
SystemState GetState(OperatingData *operating_data);
void SystemControl(bool state);

#endif /* GPIO_CONREOL_H */